/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Ewerton
 */
@Entity
@Table(name = "lotacao")
@NamedQueries({
    @NamedQuery(name = "Lotacao.findAll", query = "SELECT l FROM Lotacao l"),
    @NamedQuery(name = "Lotacao.findByIdLotacao", query = "SELECT l FROM Lotacao l WHERE l.idLotacao = :idLotacao"),
    @NamedQuery(name = "Lotacao.findByDescricao", query = "SELECT l FROM Lotacao l WHERE l.descricao = :descricao"),
    @NamedQuery(name = "Lotacao.findByCodEndereco", query = "SELECT l FROM Lotacao l WHERE l.codEndereco = :codEndereco"),
    @NamedQuery(name = "Lotacao.findByCodUnidGestora", query = "SELECT l FROM Lotacao l WHERE l.codUnidGestora = :codUnidGestora")})
public class Lotacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_lotacao")
    private Integer idLotacao;
    @Column(name = "descricao")
    private String descricao;
    @Column(name = "cod_endereco")
    private Integer codEndereco;
    @Column(name = "cod_unid_gestora")
    private Integer codUnidGestora;

    public Lotacao() {
    }

    public Lotacao(Integer idLotacao) {
        this.idLotacao = idLotacao;
    }

    public Integer getIdLotacao() {
        return idLotacao;
    }

    public void setIdLotacao(Integer idLotacao) {
        this.idLotacao = idLotacao;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Integer getCodEndereco() {
        return codEndereco;
    }

    public void setCodEndereco(Integer codEndereco) {
        this.codEndereco = codEndereco;
    }

    public Integer getCodUnidGestora() {
        return codUnidGestora;
    }

    public void setCodUnidGestora(Integer codUnidGestora) {
        this.codUnidGestora = codUnidGestora;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLotacao != null ? idLotacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lotacao)) {
            return false;
        }
        Lotacao other = (Lotacao) object;
        if ((this.idLotacao == null && other.idLotacao != null) || (this.idLotacao != null && !this.idLotacao.equals(other.idLotacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Lotacao[idLotacao=" + idLotacao + "]";
    }

}
